debian: split debug files out of xen-hypervisor-V-F and xen-utils-V
authorMaximilian Engelhardt <maxi@daemonizer.de>
Wed, 18 Jan 2023 22:02:07 +0000 (23:02 +0100)
committerHans van Kranenburg <hans@knorrie.org>
Wed, 1 Feb 2023 23:13:49 +0000 (00:13 +0100)
The debug files have grown in size over time and can no longer be
considered small.  So we now ship them uncompressed in new -dbg
packages.

The files are installed into /usr/lib/debug at the same path as the
binaries they correspond to, as described in the "Best practices for
debug packages" (Section 6.8.9) in the Debian Developer's Reference.

Signed-off-by: Maximilian Engelhardt <maxi@daemonizer.de>
debian/control
debian/rules
debian/source/lintian-overrides [new file with mode: 0644]
debian/xen-hypervisor-V-F-dbg.install.vsn-in [new file with mode: 0644]
debian/xen-hypervisor-V-F.install.vsn-in [deleted file]
debian/xen-hypervisor-V-F.lintian-overrides.vsn-in [deleted file]
debian/xen-utils-V-dbg.install.vsn-in [new file with mode: 0644]
debian/xen-utils-V.install.vsn-in

index abf7256dd541b5904992e354fea8601366b4f536..906b6a40130fa2d147744cfbd36fdddbb0998648 100644 (file)
@@ -114,6 +114,16 @@ Description: Xen administrative tools
  qemu-utils and seabios are needed for "Xen HVM" (amd64)
 Built-Using: ${misc:Built-Using}
 
+Package: xen-utils-4.17-dbg
+Section: debug
+Architecture: amd64 arm64 armhf
+Priority: optional
+Depends: xen-utils-4.17 (= ${binary:Version}), ${misc:Depends}
+Description: debug symbols for xen-utils-4.17
+ This package provides debug symbols for the xen-utils binaries as well as
+ detached debug symbols for the `shim' used for booting PV guests in an HVM
+ container.
+
 Package: xen-hypervisor-4.17-amd64
 Section: kernel
 Architecture: amd64
@@ -125,6 +135,14 @@ Description: Xen Hypervisor on AMD64
  loader and controls cpu and memory, sharing them between your
  administrative domain (Domain 0) and the virtual guest systems.
 
+Package: xen-hypervisor-4.17-amd64-dbg
+Section: debug
+Architecture: amd64
+Priority: optional
+Depends: xen-hypervisor-4.17-amd64 (= ${binary:Version}), ${misc:Depends}
+Description: debug symbols for Xen Hypervisor on AMD64
+ This package provides the detached debug symbols for the Xen hypervisor.
+
 Package: xen-system-amd64
 Section: admin
 Architecture: amd64
@@ -145,6 +163,14 @@ Description: Xen Hypervisor on ARM64
  loader and controls cpu and memory, sharing them between your
  administrative domain (Domain 0) and the virtual guest systems.
 
+Package: xen-hypervisor-4.17-arm64-dbg
+Section: debug
+Architecture: arm64
+Priority: optional
+Depends: xen-hypervisor-4.17-arm64 (= ${binary:Version}), ${misc:Depends}
+Description: debug symbols for Xen Hypervisor on ARM64
+ This package provides the detached debug symbols for the Xen hypervisor.
+
 Package: xen-system-arm64
 Section: admin
 Architecture: arm64
@@ -165,6 +191,14 @@ Description: Xen Hypervisor on ARMHF
  loader and controls cpu and memory, sharing them between your
  administrative domain (Domain 0) and the virtual guest systems.
 
+Package: xen-hypervisor-4.17-armhf-dbg
+Section: debug
+Architecture: armhf
+Priority: optional
+Depends: xen-hypervisor-4.17-armhf (= ${binary:Version}), ${misc:Depends}
+Description: debug symbols for Xen Hypervisor on ARMHF
+ This package provides the detached debug symbols for the Xen hypervisor.
+
 Package: xen-system-armhf
 Section: admin
 Architecture: armhf
index 7a834116720119d61391921ee2b6e3c1b688190a..d16b236f66f806ec877269bd6973f08c61f270c1 100755 (executable)
@@ -301,24 +301,33 @@ override_dh_installinit:
        dh_installinit --name xen --no-start -- defaults
        dh_installinit --name xendomains --no-start -- defaults
 
+# We want to ship xen-shim-syms in a -dbg package, but if we just add a
+# xen-utils-V-dbg package for it, lintian will complain with the following
+# warning:
+# W: xen changes: package-builds-dbg-and-dbgsym-variants xen-utils-V-dbg xen-utils-V-dbgsym
+# So we disable the generation of an automatic dbgsym packages for xen-utils-V
+# and ship the automatically generated files in our xen-utils-V-dbg package.
+#
 # Don't strip the .note section from xen-shim. See also
 # debian/xen-utils-V.lintian-overrides.vsn-in
+#
+# Finally, don't strip anything in the -dbg packages
 override_dh_strip:
-       dh_strip --exclude=xen-shim
+       dh_strip --package=xen-utils-$(upstream_version) \
+               --dbg-package=xen-utils-$(upstream_version)-dbg \
+               --exclude=xen-shim
+       dh_strip --remaining-packages \
+               --no-package=xen-utils-$(upstream_version)-dbg \
+               --no-package=xen-hypervisor-$(upstream_version)-$(flavour)-dbg
 
 # Hardlink the various xenstore-* programs together.  This is an
 # argv[0]-using binary of which we can have only one copy.  We need to
 # do this late, because dh_strip breaks hardlinks.
-#
-# The debug files are fairly large, fairly rarely used,
-# and not compressed by the upstream build system.
 override_dh_compress:
        rdfind -makehardlinks true -makeresultsfile false \
                debian/xenstore-utils/usr/bin
        :
        dh_compress -Xusr/share/doc/xen/html
-       find debian/xen-hypervisor-*/usr/lib/debug -type f -print0 \
-               | xargs -0r gzip -9vn
 
 # We are dropping the config file /etc/default/xen which appeared in
 # earlier versions.  See ./ucf-remove-fixup for more details.
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644 (file)
index 0000000..c7687b2
--- /dev/null
@@ -0,0 +1,5 @@
+# We install the hypervisor and shim debug files in our own -dbg packages.
+# Those files are not installed by the automatic -dbgsym packages, so we can't
+# use these.
+xen source: debian-control-has-obsolete-dbg-package *xen-hypervisor-*-dbg*
+xen source: debian-control-has-obsolete-dbg-package *xen-utils-*-dbg*
diff --git a/debian/xen-hypervisor-V-F-dbg.install.vsn-in b/debian/xen-hypervisor-V-F-dbg.install.vsn-in
new file mode 100644 (file)
index 0000000..071155a
--- /dev/null
@@ -0,0 +1,3 @@
+usr/lib/debug/xen* usr/lib/debug/boot/
+# ^ The xen* wildcard excludes the shim symbols.  The shim is treated
+#   as part of the toolstack - see xen-utils-V-dbg.install.vsn-in.
diff --git a/debian/xen-hypervisor-V-F.install.vsn-in b/debian/xen-hypervisor-V-F.install.vsn-in
deleted file mode 100644 (file)
index a211b1d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-usr/lib/debug/xen* usr/lib/debug/
-# ^ The xen* wildcard excludes the shim symbols.  The shim is treated
-#   as part of the toolstack - see xen-utils-V.install.vsn-in.
diff --git a/debian/xen-hypervisor-V-F.lintian-overrides.vsn-in b/debian/xen-hypervisor-V-F.lintian-overrides.vsn-in
deleted file mode 100644 (file)
index e8ea833..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# Aas is traditional for kernels too, we ship the debug information
-# in the hypervisor package rather than creating yet another
-# package just for this file, which is only 50K or so anyway.
-debug-suffix-not-dbg *usr/lib/debug/xen-*.efi.map.gz*
diff --git a/debian/xen-utils-V-dbg.install.vsn-in b/debian/xen-utils-V-dbg.install.vsn-in
new file mode 100644 (file)
index 0000000..d7a89c0
--- /dev/null
@@ -0,0 +1,3 @@
+? flavour = amd64
+usr/lib/debug/usr/lib/xen-*/boot/*
+?
index da04b59d4276cd82af35e466888d1e813067806e..977bd8025bb56681ca6310f997f8086fa656aefc 100644 (file)
@@ -3,7 +3,4 @@ usr/lib/xen-@version@/lib/python
 
 ? flavour = amd64
 usr/lib/xen-@version@/boot
-usr/lib/debug/usr/lib/xen-*/boot/* usr/lib/debug/xen-syms-@version@-shim
-# ^ Yes, the upstream build system really does install the shim symbols
-#   file in debian/tmp/usr/lib/debug/usr/lib/xen-@version@/boot/xen-shim-syms
 ?